package com.job.sun.HomeWork0715;

import java.util.Arrays;

/**
 * @author 张春阳
 * @version 1.0
 * @since 2022-07-18 14:14:00
 */
public class String04 {
    public static void main(String[] args) {
        String name="lucy_lili_luck";
        name.replace('l', 'L');
        System.out.println( name.replace('l', 'L'));
        String newName2=name.replace("li", "WE");
        System.out.println(newName2);
        String[] names =name.split("_");
        System.out.println(Arrays.toString(names));
        String[] names2=name.split("_",2);
        System.out.println(Arrays.toString(names2));
        String ss1="https://www.summer.com/news/login.action";
        //截取  主机出来
        //找www第一次出现的下标
        int index=ss1.indexOf("www");
        //找www之后  / 第一次出现的下标
        int indexSlash=ss1.indexOf("/",index);
        String host=ss1.substring(index,indexSlash);
        System.out.println(host);
        System.out.println(ss1.toUpperCase());

        String username=" sdakda";
        System.out.println(username.length());
        username=username.trim();
        System.out.println(username.length());
    }
}